<!DOCTYPE html>
<html>

<head>
	<title></title>
	<link rel="stylesheet" href="${ctxPath!}/admin/admin/css/index.css">

	<!--	<link href='//fonts.googleapis.com/css?family=Open+Sans:400,300italic,300,400italic,600,600italic,700,700italic,800,800italic' rel='stylesheet' type='text/css'>
	<link href='//fonts.googleapis.com/css?family=Lato:400,100,100italic,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>-->

	<meta name="viewport" content="width=device-width, initial-scale=1" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="keywords" content="Lambent Login Form Responsive, Login Form Web Template, Flat Pricing Tables, Flat Drop-Downs, Sign-Up Web Templates, Flat Web Templates, Login Sign-up Responsive Web Template, Smartphone Compatible Web Template, Free Web Designs for Nokia, Samsung, LG, Sony Ericsson, Motorola Web Design"
	/>
	<script type="application/x-javascript">
		addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); }
	</script>
	<script src="admin/js/jquery-form.js"></script>
</head>

<body>
	<h1><!--外卖管理后台--></h1>
	<div class="main-agileinfo">
		<h2>登录</h2>

		<div class="indexWidth">
			<input type="text" name="name" class="name" id="name" placeholder="请输入帐号" required="">
			<input type="password" name="password" class="password" id="password" placeholder="请输入密码" required="">
			<!--<ul>
				<li>
					<input type="checkbox" id="brand1" value="">
					<label for="brand1"><span></span>记得我</label>
				</li>
			</ul>
            <a href="#">忘记密码?-->
			</a><br>
			<div id="msgs" class="clear"></div>
			<button type="button" id="submit" onclick="submit()">登录<button>
		</div>
	</div>
	<div class="footer-w3l">
		<p class="agile">Copyright © 2016.Company name All rights reserved.由<a target="_blank" href="http://www.b3ad.cn/">北山广告</a></a></p>
	</div>
	<!--<script type="text/javascript" src="js/index.js"></script>-->
	<script src="${ctxPath!}/admin/admin/js/jquery.min.js"></script>
	<script>
		// $(function(){
		function submit() {
			var name = document.getElementById("name").value;
			var password = document.getElementById("password").value
			if (name == "" || name == null) {
				$("#name").focus();
                $('#msgs').html("请输入用户名");
				return;
			}
			if (password == "" || password == null) {
				$("#password").focus();
                $('#msgs').html("请输入密码");
				return;
			}
			var path = '${ctxPath!}'
			$.ajax({
				url: path + '/user/login',
				type:'GET',
				data: {
					'account':name,
					'password':password
				},
				success: function (res) {
					if (res.code == 200) {

						window.location.href = path + '/platform';

					} else {
						$('#msgs').html(res.msg);
					}
				},
				error: function (res) {
                    $('#msgs').html(res);
				}
			})
		}
		// })
	</script>
</body>
</html>